/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.alpha.util;

import java.util.Iterator;
import org.htmlparser.Node;
import org.htmlparser.util.NodeIterator;
import org.htmlparser.util.ParserException;

/**
 *
 * @author alvar
 */
public class SiblingIterator implements NodeIterator {
	Node node;
	public SiblingIterator(Node node){
		this.node = node;
	}

	@Override
	public boolean hasMoreNodes() throws ParserException {
		if (node instanceof Node){
			if (node.getNextSibling()!=null){
				return true;
			}
			
		}
		return false;
	}

	@Override
	public Node nextNode() throws ParserException {
		node = node.getNextSibling();
		return node;
	}

}